//
//  UIView+Shadow.h
//  WangMaBorrowArchitecture
//
//  Created by ming tan on 2019/3/7.
//  Copyright © 2019 ming tan. All rights reserved.
//

#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, QHLDirection) {
     QHLDirectionHorizontal,
     QHLDirectionVertical
 };

typedef NS_OPTIONS(NSUInteger, BorderDirection) {//需要显示的边框方向
    BorderDirectionLeft     = 1 << 0,
    BorderDirectionRight    = 1 << 1,
    BorderDirectionBottom  = 1 << 2,
    BorderDirectionTop = 1 << 3,
    BorderDirectionAllCorners  = ~0UL
};
NS_ASSUME_NONNULL_BEGIN

@interface UIView (Shadow)

@property(nonatomic,unsafe_unretained)IBInspectable BorderDirection BD;//需要显示边框的方向  等于0时，什么方向都不画
@property(nonatomic,unsafe_unretained)IBInspectable UIRectCorner corners;//需要设置圆角的方向 等于0时，什么方向都不画
@property(nonatomic,unsafe_unretained)IBInspectable CGFloat radius;//圆角角度
@property(nonatomic,unsafe_unretained)IBInspectable CGFloat borderWidth;//边框宽度
@property(nonatomic,strong)IBInspectable UIColor *borderColor;//边框颜色
- (void)addTopGeneralShadow;
- (void)addGeneralShadow;
/**
 * color 阴影颜色
 * cornerRadius 按钮圆角
 * here 在拿一边添加阴影 1上 2左 3下 4右
 */
- (void)addGeneralShadow:(UIColor *)color WithRadius:(CGFloat)cornerRadius WithShadowRadius:(CGFloat)shodowRadius WithHere:(int)here;
- (void)addCorner:(CGFloat)cornerRadius;
- (void)addTopCorner;
- (void)addLine:(UIColor *)color AndLineWidth:(CGFloat)width;
- (void)customizedCornerTopLeft:(CGFloat)topLeft topRight:(CGFloat)topRight bottomLeft:(CGFloat)bottomLeft bottomRight:(CGFloat)bottomRight;
- (void)addShowAnimation;
- (void)addDissAnimation;
- (void)addCorner:(CGFloat)cornerRadius AndLine:(UIColor *)color;
- (void)addStartPoint:(CGPoint)startPoint AndendPoint:(CGPoint)endPoint AndColors:(NSArray *)colors;
- (void)shakeWithShakeDirection:(QHLDirection)shakeDirection;
- (void)shakeWithTimes:(NSInteger)times shakeDirection:(QHLDirection)shakeDirection;
- (void)shakeWithTimes:(NSInteger)times speed:(CGFloat)speed shakeDirection:(QHLDirection)shakeDirection;
- (void)shakeWithTimes:(NSInteger)times speed:(CGFloat)speed range:(CGFloat)range shakeDirection:(QHLDirection)shakeDirection;
- (void)forceClips;

- (void)setVariableRoundedBorder:(CGRect)rect view:(UIView *)view  BD:(BorderDirection)BD corners:(UIRectCorner)corners radius:(CGFloat)radius borderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderColor;
-(void)setRounded:(CGRect)rect view:(UIView *)view corners:(UIRectCorner)corners;
// 判断View是否显示在屏幕上
- (BOOL)isDisplayedInScreen;

-(void)addBottomBorderWithColor: (UIColor *) color andWidth:(CGFloat) borderWidth;

-(void)addLeftBorderWithColor: (UIColor *) color andWidth:(CGFloat) borderWidth;

-(void)addRightBorderWithColor: (UIColor *) color andWidth:(CGFloat) borderWidth;

-(void)addTopBorderWithColor: (UIColor *) color andWidth:(CGFloat) borderWidth;


@end

NS_ASSUME_NONNULL_END
